<?php
	/* Functions in this file */
	/**************************/

	// GetData()
	// GetMFCClassName()
	// GetMFCClassSchema()
	// GetPosition()
	// GetSystem()
	// IsValidPosition($position)
	// IsValidSystem($system)
	// SetData($data)
	// SetPosition($position)
	// SetSystem($system)
?>
<?php
	 
	 
	 
	 
	class SystemSymbol {
		 
		 
		// Default constants
		const DEFAULT_SYSTEM = 0;
		const DEFAULT_POSITION = 0;
		const DEFAULT_DATA = 0;
		 
		// System Constants
		const MIN_SYSTEM = 0;
		const MAX_SYSTEM = 65535;
		 
		// Position Constants
		const MIN_POSITION = 0;
		const MAX_POSITION = 255;
		 
		 
		protected $m_system = self::DEFAULT_SYSTEM;
		protected $m_position = self::DEFAULT_POSITION;
		protected $m_data = self::DEFAULT_DATA;
		 
		 
		// MFC Class Functions
		 
		 
		function GetMFCClassName() {
			return "CSectionSymbol";
		}
		 
		 
		function GetMFCClassSchema() {
			return 1;
		}
		 
		// System Functions
		 
		 
		 
		function IsValidSystem($system) {
			return (($system >= self::MIN_SYSTEM) && ($system <= self::MAX_SYSTEM));
		}
		 
		 
		 
		function SetSystem($system) {
			if (!$this->IsValidSystem($system)) return 0;
			$this->m_system = $system;
			 return 1;
		}
		 
		 
		function GetSystem() {
			return ($this->m_system);
		}
		 
		// Position Functions
		 
		 
		 
		function IsValidPosition($position) {
			return (($position >= self::MIN_POSITION) && ($position <= self::MAX_POSITION));
		}
		 
		 
		 
		function SetPosition($position) {
			if (!$this->IsValidPosition($position)) return 0;
			$this->m_position = $position;
			 return 1;
		}
		 
		 
		function GetPosition() {
			return ($this->m_position);
		}
		 
		// Data Functions
		 
		 
		function SetData($data) {
			$this->m_data = $data;
		}
		 
		 
		function GetData() {
			return ($this->m_data);
		}
		 
		 
		 
		public function SystemSymbol($system = NULL, $position = NULL, $data = NULL) {
			 
			//------Last Checked------//
			// - Jan 13, 2005
			if (!$this->IsValidSystem($system)) return 0;
			if (!$this->IsValidPosition($position)) return 0;
			$this->SetSystem($system);
			$this->SetPosition($position);
		}
		 
		// Serialize Functions
		 
		 
		public function DoSerialize(&$stream){
		
			WRITE_WORD ($stream,$this->m_system);
			WRITE_BYTE ($stream,$this->m_position);
			WRITE_INTEGER ($stream,$this->m_data);

			return 1;
		}
		 
		 
		 
		public function DoDeserialize(&$stream){
		 
			$this->m_system = READ_WORD ($stream);
			$this->m_position = READ_BYTE ($stream);
			$this->m_data = READ_INTEGER ($stream);
		
		}
		
		 
	}
	 
?>

